package ee.ut.maxorato_macobo.oop.mud.items;

import ee.ut.maxorato_macobo.oop.mud.game.GameCharacter;

public class ItemArmour extends ItemBase {
	private ItemArmourTemplate itemTemplate;
	
	public ItemArmour(ItemTemplate newItemTemplate, ContainsItems newItemLocation) {
		super(newItemTemplate, newItemLocation);
		
		itemTemplate = (ItemArmourTemplate)newItemTemplate;
	}
	
	public String getWearLocation() {
		return itemTemplate.getWearLocation();
	}
	
	public int getPierceDefBonus() {
		return itemTemplate.getPierceDefBonus();
	}
	
	public int getBashDefBonus() {
		return itemTemplate.getBashDefBonus();
	}
	
	public int getSlashDefBonus() {
		return itemTemplate.getSlashDefBonus();
	}

	public int getMagicDefBonus() {
		return itemTemplate.getMagicDefBonus();
	}
	
	@Override
	public ItemBase clone() {
		ItemBase clonedItem = new ItemArmour(itemTemplate, itemLocation);
		
		if(clonedItem.getLocation() instanceof GameCharacter.EquipmentContainer) {
			clonedItem.moveToLocation(((GameCharacter.EquipmentContainer)clonedItem.getLocation()).getListOwner());
		}
		
		return clonedItem;
	}
}
